UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UzUVcl78QGLxL1BXk83SzhpIjseMXqi640hJzaPR2WE=' 
WHERE 
  key_id = 'c37ff0b1117df3669b18eef4ad0304880bc7c1335f681d3357dd156de6717780' 
  AND (
    token = 'UzUVcl78QGLxL1BXk83SzhpIjseMXqi640hJzaPR2WE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033