UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'naRY2f+owLzCZ3JcOYH7XQs2yo1yzooqNTLCYFRyQL0='
WHERE
key_id = '61a799ce3e2a1202f7960883f4c0fa444be12e26fe5077a9163aaf92daf7185c'
AND (
token = 'naRY2f+owLzCZ3JcOYH7XQs2yo1yzooqNTLCYFRyQL0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)