UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/6pTU2jax5+K1qFqhJjcH4LFCJfcSX1IV1DB81thWSI=' 
WHERE 
  key_id = '668e5e75e0d50902024dab07b07ae38a4ba079efd16ad667c4c439986cff15e8' 
  AND (
    token = '/6pTU2jax5+K1qFqhJjcH4LFCJfcSX1IV1DB81thWSI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015