UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AmFc1Ff8fhhVlBfU8sow9uE/HYVsCkW/UCTR3prEEYs='
WHERE
key_id = 'ed989bd60b76384e38127dc02b331fd8e5e5e593e7f7420a4be1d38045cf1a4f'
AND (
token = 'AmFc1Ff8fhhVlBfU8sow9uE/HYVsCkW/UCTR3prEEYs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)