UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IEMoubJfNsHFwlqTOIKpIWypQt1fsfM/2Lif2qcVzBo='
WHERE
key_id = 'd1b030b16d494a08f0e57a9cf7575c91d20e9e555324aafcd03ef3e865d54cb6'
AND (
token = 'IEMoubJfNsHFwlqTOIKpIWypQt1fsfM/2Lif2qcVzBo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)