UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bTEx1Ld08g741yof/n9mQhn3rGH6yX7Sh1lnm1zeKXw='
WHERE
key_id = 'a490d9a65eae50c447edef839addee2a9ef81d7150c5ab4af2a312f46f0ffa08'
AND (
token = 'bTEx1Ld08g741yof/n9mQhn3rGH6yX7Sh1lnm1zeKXw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)