UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vkB9yZmtC2AminzumgnkHUSSOYyMdd9nic0cpT09Cb4=' 
WHERE 
  key_id = '72ec501c31f966fb3892bda65c61af57f794521fbc845f13f420fdb87f0fcd62' 
  AND (
    token = 'vkB9yZmtC2AminzumgnkHUSSOYyMdd9nic0cpT09Cb4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032