UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'At1whvKPfacYXyhfQtKpQTt5dXAnKEJ591d/V8zHssQ=' 
WHERE 
  key_id = '37f32c11f8458c4b1d46c1e52d10306bd06f384ff15e184ca84d69000ddbe57f' 
  AND (
    token = 'At1whvKPfacYXyhfQtKpQTt5dXAnKEJ591d/V8zHssQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039