UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qNttcc3Ir5WGQJocpCL5S6lHS1JglG3K+PQnD4AI8/I=' 
WHERE 
  key_id = '106e1793aad3c5295d12f442d1bf0caa92c0624e0bc11b3959e0ec400bf9ac09' 
  AND (
    token = 'qNttcc3Ir5WGQJocpCL5S6lHS1JglG3K+PQnD4AI8/I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029