UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '08zhu/Rt6Xe4bKs0urVwNSHMvCTz2+VrHQuMUocAqpU=' 
WHERE 
  key_id = '808798cfb3388424656c2969d467f33147224feb50a8b2a841429f34a03d4ccd' 
  AND (
    token = '08zhu/Rt6Xe4bKs0urVwNSHMvCTz2+VrHQuMUocAqpU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051