UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EVuXtW9DkJoUD00nGc+fprhp9b7AvrdbkemhLMLiEas='
WHERE
key_id = '1dd7d4bbbca3471d52454c7ee026842b6fdebaba6a7c6615641885f61b50714f'
AND (
token = 'EVuXtW9DkJoUD00nGc+fprhp9b7AvrdbkemhLMLiEas='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)