UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IDXQ1/4ThS5tc+mt4/YHm9JT8IuYOJjkIxMuhcHa1N4='
WHERE
key_id = 'b0e830bd5e3a0b8aec81a1fc60c5c5bebddbde0c167a586833b8dd4501e1d844'
AND (
token = 'IDXQ1/4ThS5tc+mt4/YHm9JT8IuYOJjkIxMuhcHa1N4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)