UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xq+/huyR2ULHUgg7MR23Lf6vUn5vEBKowTAU37zaM40='
WHERE
key_id = 'f6faa06528c391e7af09a79162a1b6eaf51001ef6b5927d7670014e012c4da5b'
AND (
token = 'xq+/huyR2ULHUgg7MR23Lf6vUn5vEBKowTAU37zaM40='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)