UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0w0BWWNgZFiMj8rxR+hJITBXeA5O6+ZHjT8H6SBByzM='
WHERE
key_id = '62f5ad28479b19042de6bc930e559a43c8744d6d7efb030efde1a58975bfe28c'
AND (
token = '0w0BWWNgZFiMj8rxR+hJITBXeA5O6+ZHjT8H6SBByzM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)