UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Kjy7HxDHq5KO3LoPVMMey32qdAAOqFKHydDnNgXM/r8='
WHERE
key_id = 'fb88fd8eaf8ecdbc263f305185690c20b8133eea909da2d4b1a4eeb90eabbd09'
AND (
token = 'Kjy7HxDHq5KO3LoPVMMey32qdAAOqFKHydDnNgXM/r8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)