UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DTGzggGa0G5zj2FM+EFsIShHMBWXVRLbB2SmNBsKcP4=' 
WHERE 
  key_id = 'f73a6ddd0289ece40993bd76e9ecacb6bbe9ab480e6c7415b57ce9c633b64988' 
  AND (
    token = 'DTGzggGa0G5zj2FM+EFsIShHMBWXVRLbB2SmNBsKcP4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031