UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'H+U0vwkrO3qMOfE5VhUn8wDXMqAqmphT3Q8jQsUY3qE='
WHERE
key_id = '2d00597c5acc7b58ab49ee3f36155f89eedfb23aa397d9b23603b7af22f791a1'
AND (
token = 'H+U0vwkrO3qMOfE5VhUn8wDXMqAqmphT3Q8jQsUY3qE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)