UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sEqG3dNTW3bkQhO7EF1OxRVVoZTIhAVyt7NY250jzPc='
WHERE
key_id = '37001f3f779e146b81107539b4e86aec75ba2810a074d39df7224365e7bfb695'
AND (
token = 'sEqG3dNTW3bkQhO7EF1OxRVVoZTIhAVyt7NY250jzPc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)