UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lG/d0TDBi3n+fYm/WITmqbuXKNLzn6gtCexHQWAI4U0='
WHERE
key_id = '846efc6e852cd089347ed28709f2b7b49f38baae1fa1213409de121827a446df'
AND (
token = 'lG/d0TDBi3n+fYm/WITmqbuXKNLzn6gtCexHQWAI4U0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)