UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8VGhl7unsc7gUI88sEqEJ7G3uZY3PP09CGmhhAf912I='
WHERE
key_id = '042654c1000139fc82c729b4d7a6f6c3061b09eed09470e7121f5cceecab2425'
AND (
token = '8VGhl7unsc7gUI88sEqEJ7G3uZY3PP09CGmhhAf912I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)