UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DFE3l5a/65q2uSYUtSQyFWO8+hA8sUGJgmAYIDCV65w='
WHERE
key_id = '9bd5f1dc6f5ca6b30c5266a83bf1a8f0b1cace895c830e9225140dda42d57a0f'
AND (
token = 'DFE3l5a/65q2uSYUtSQyFWO8+hA8sUGJgmAYIDCV65w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)