UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yqTDq/ceYOpi9ofp4L0dY7I9g4zy0yXaVdVPUj630HQ=' 
WHERE 
  key_id = '3bd23db73df13642e6ea4fe14e54bd5bfd683c80ff0f84eb8bdea23d721a7942' 
  AND (
    token = 'yqTDq/ceYOpi9ofp4L0dY7I9g4zy0yXaVdVPUj630HQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039