UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NibK+u/9AcEcKf6AA6EsXJqcv8Idg+S32dryO3pP+Fc=' 
WHERE 
  key_id = '1418bbbf99735cc4ce568ae0ab5a7db7fefb3ace6fce20561dbe75c91684b0a5' 
  AND (
    token = 'NibK+u/9AcEcKf6AA6EsXJqcv8Idg+S32dryO3pP+Fc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028