UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xTmrjPXSfhQ0RhvCsNct6pOhNW+Yej8UGDUkthwBCy8='
WHERE
key_id = '61158cb595b25c13f2124fddcfb081216f495a2c0c2d40b45dc24fe97c77f162'
AND (
token = 'xTmrjPXSfhQ0RhvCsNct6pOhNW+Yej8UGDUkthwBCy8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)