UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uxolJiBoY5UkZUl3/4GpPpCpSFizdGGqfQnawa6ACjE='
WHERE
key_id = 'c0e0ee2d0a8f153dd7aee684aafb033559de2337195182731257fa9188a963ff'
AND (
token = 'uxolJiBoY5UkZUl3/4GpPpCpSFizdGGqfQnawa6ACjE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)