UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'opp/OCrbofjt921PfXjEpderiA7mtrIQ3sw+KTApWc0='
WHERE
key_id = 'c0e0e7141f77bf9b3707aa32adc8936575012ec87dfd4aa19461f5de3a75f4fc'
AND (
token = 'opp/OCrbofjt921PfXjEpderiA7mtrIQ3sw+KTApWc0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)