UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/Mm4rfQQA2bAiLoalHALESHHOCNOYTOOTdFB4yFoVLk='
WHERE
key_id = '551dc97893a6c2d7741d2ff1886bc58ac24db946b27c62d8bf7519d861734ee8'
AND (
token = '/Mm4rfQQA2bAiLoalHALESHHOCNOYTOOTdFB4yFoVLk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)