UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DHyQg3agpvyBlNzUGFs3VKkF41zbjMsUMVO8RD61LPk='
WHERE
key_id = '5b242f1f7a27ecad94dfe666e20e8c4f40afe03f026e7065761a6c33ca6f74fd'
AND (
token = 'DHyQg3agpvyBlNzUGFs3VKkF41zbjMsUMVO8RD61LPk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)