UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ccb1L0c6kbP5tfFZNW9RfaUYc+buj5GvOzD7D2QWgjg=' 
WHERE 
  key_id = 'd435683cf0c9be45cb6dac8d9769a53c0586ffea4bdf41f7b759ce30ef90fc7c' 
  AND (
    token = 'Ccb1L0c6kbP5tfFZNW9RfaUYc+buj5GvOzD7D2QWgjg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035