UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ASRSYb2TiSGamTrEzrF30gWCbSDQ9LR+KWZWv1Y/glg='
WHERE
key_id = '9fd784f2ed50d465c53af847853e24a235b2302ace7924f2c041534e3b0b0ec6'
AND (
token = 'ASRSYb2TiSGamTrEzrF30gWCbSDQ9LR+KWZWv1Y/glg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)