UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'C0BPFZNKLB4PygVzGs/709YnmJf3hMsskMZpLz3q6Ss=' 
WHERE 
  key_id = '0845c9c5c9732579592f5cdf5b08df670bc967f958a3a550536af977aa6cfaf0' 
  AND (
    token = 'C0BPFZNKLB4PygVzGs/709YnmJf3hMsskMZpLz3q6Ss=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016