UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hFd4lawFQAMTlaXiFAmU3hsu80W/dZnxOVHYxB6X9tI=' 
WHERE 
  key_id = '91ca3ddf5eef04233bd5c0e84fe274fdd1e9905343d80cc30a3e41c09bb991ea' 
  AND (
    token = 'hFd4lawFQAMTlaXiFAmU3hsu80W/dZnxOVHYxB6X9tI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029