UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kCeznHcg6QUVCyl1lfPJZ7HaVSLFvWlXJhzhpbwfR58=' 
WHERE 
  key_id = '026ec549e2b6383a1ea3b1d277c2fd895c122b6a2eaf39e9a9e90b12b98b4d0d' 
  AND (
    token = 'kCeznHcg6QUVCyl1lfPJZ7HaVSLFvWlXJhzhpbwfR58=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044