UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ErTfrNvJnkePRL6lllccWgAdYvf3KFkg+jhYNd9RBug=' 
WHERE 
  key_id = 'fd00142c58d8d50c88c948230a9598e4d827797774544d143a0fe8d49a38f910' 
  AND (
    token = 'ErTfrNvJnkePRL6lllccWgAdYvf3KFkg+jhYNd9RBug=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029