UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bJ/kEO/LmVIBGO4DU/e1hJ9FWTwLlU6d1S46/39alsM=' 
WHERE 
  key_id = '3bf8d9401dcc1672dcf71dd7cff6a9030653feda327a2f48e62af5a38eea8d83' 
  AND (
    token = 'bJ/kEO/LmVIBGO4DU/e1hJ9FWTwLlU6d1S46/39alsM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052