UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iKlYzuEdnpLuXy7B1hX5B5XAX7wRNAld+jvUwdf+T2s='
WHERE
key_id = '15140843c5f02c538e517781d4ff0b3e9438af734a3a455bad94519c96271a4f'
AND (
token = 'iKlYzuEdnpLuXy7B1hX5B5XAX7wRNAld+jvUwdf+T2s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)