UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yF/lGnJN8fgHOofhQ/vYQCeylM6nTpKAOnOWeip91TM=' 
WHERE 
  key_id = 'f2f402d420d2a9c403bca63bedb44e20f6dd1908a5a5a94089767570d8a738e3' 
  AND (
    token = 'yF/lGnJN8fgHOofhQ/vYQCeylM6nTpKAOnOWeip91TM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047