UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6tVo1SB0wxtGepmU55n666dCl8sW/qK8OD7A4PBWZCw=' 
WHERE 
  key_id = 'df4f00ef0ae3a9a9db8f9d35c209a9d0230838ce672164892523865032dab1d9' 
  AND (
    token = '6tVo1SB0wxtGepmU55n666dCl8sW/qK8OD7A4PBWZCw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034