UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QvRBV8XLrKyRp8PJgCF7w+y/HYgv0jDS/M9iL6P1Aqc='
WHERE
key_id = 'fc5863aac7a77e657a7daef9dda5b9e0536facfe5482e73e0f1eb42b5172d0be'
AND (
token = 'QvRBV8XLrKyRp8PJgCF7w+y/HYgv0jDS/M9iL6P1Aqc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)