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

Query time 0.00031