UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FkLPoFgSAM0j5mJ989YuOQDw742GuXAtAZ31GnTBwKQ='
WHERE
key_id = '74e558afdffcf1fd5767c53d799393fc8f5d9c751f2e3d394d8c70903b69ea1b'
AND (
token = 'FkLPoFgSAM0j5mJ989YuOQDw742GuXAtAZ31GnTBwKQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)