UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kO14LwpcitF0pwR5zL4mZ/PHV0+GaZcLVI0ZkpRpv8I=' 
WHERE 
  key_id = '4046531828b0a8fed96ea042d52cfa077f9d9e8f95c8b69b36f064657e5921c4' 
  AND (
    token = 'kO14LwpcitF0pwR5zL4mZ/PHV0+GaZcLVI0ZkpRpv8I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040