UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '11mA3IRAloTzY6wlgAm8a5jyLWzw78waWm5uwL0GXrc='
WHERE
key_id = '051f8caa9b5ab70fbf546862d292c980b989e27ff8e56577ef06bf14adc07959'
AND (
token = '11mA3IRAloTzY6wlgAm8a5jyLWzw78waWm5uwL0GXrc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)