UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3b+bnxDHxs0PJ6zguvztsoUVOdq6Yk73Y63We5NXlqU=' 
WHERE 
  key_id = '6e30713d20a81ade299ac1fff74673bfa6faefe9e02d451a90ae4a1f633fa1e6' 
  AND (
    token = '3b+bnxDHxs0PJ6zguvztsoUVOdq6Yk73Y63We5NXlqU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051