UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '82bGWDhDALR7lPa3dPVhUr1zDutG5ifKCKEqyHrr5aA=' 
WHERE 
  key_id = '2e8da8c2012e85c60c587313a8596229b7d4c4b520e098bfa4ef1802a157df39' 
  AND (
    token = '82bGWDhDALR7lPa3dPVhUr1zDutG5ifKCKEqyHrr5aA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036