UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SOvoPCJ+zwWGmWFFG1KnVI1hc6wwNXvVkhEtb3OST/s='
WHERE
key_id = 'bcee93d684074ffb4067fabc52ff8ba805c63d04338342be1101e4b2bfce8489'
AND (
token = 'SOvoPCJ+zwWGmWFFG1KnVI1hc6wwNXvVkhEtb3OST/s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)