UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Se4Voxru22a6usm0WAAvlbmklXGYywwnmU1aySuPaJs='
WHERE
key_id = '7ad46b644ced683692db256464929d9a5640b64f752ae5b35af7a7a7539eedc8'
AND (
token = 'Se4Voxru22a6usm0WAAvlbmklXGYywwnmU1aySuPaJs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)