UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SPleb3NAivBJe8AtDd/IHfhWSqVBc93sQOYhBEbo8wE=' 
WHERE 
  key_id = 'ba94c33dbfaca82571c617eedd3de389124886cfc71a4c5c477f47b9b8e11bdb' 
  AND (
    token = 'SPleb3NAivBJe8AtDd/IHfhWSqVBc93sQOYhBEbo8wE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049